package com.sixks.app.domain;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author colin
 * @date: 02/03/2014
 * @time: 19:07
 */
public class Category {

    private int id;
    private String zhName;
    private String enName;
    private boolean isleaf;
    private Category parent;
    private int level;
    private List<Category> children = new ArrayList<Category>();

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getZhName() {
        return zhName;
    }

    public void setZhName(String zhName) {
        this.zhName = zhName;
    }

    public String getEnName() {
        return enName;
    }

    public void setEnName(String enName) {
        this.enName = enName;
    }

    public boolean isIsleaf() {
        return isleaf;
    }

    public void setIsleaf(boolean isleaf) {
        this.isleaf = isleaf;
    }

    public void setNames(Map names) {
        this.enName = names.get("en").toString();
        this.zhName = names.get("zh").toString();
    }

    public List<Category> getChildren() {
        return children;
    }

    public void setChildren(List<Category> children) {
        this.children = children;
        for(Category each: children){
            each.setParent(this);
        }
    }

    public Category getParent() {
        return parent;
    }

    public void setParent(Category parent) {
        this.parent = parent;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
